package com.chinasoft.movies.controller;

import com.chinasoft.movies.pojo.Top10MoviesInGenre;
import com.chinasoft.movies.service.Top10MoviesInGenreService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Log4j2
@CrossOrigin
public class Top10MoviesInGenreController {

    @Autowired
    Top10MoviesInGenreService top10MoviesInGenreService;

    //根据类型查询票房前十和热度前十的电影的并集
    //返回：String title; Long revenue; double popularity;
    @GetMapping("/queryTop10MoviesInGenre")
    public List<Top10MoviesInGenre> queryTop10MoviesInGenre(String genre){
        List<Top10MoviesInGenre> result = top10MoviesInGenreService.queryTop10MoviesInGenre(genre);
        return result;
    }
}
